//
//  IndexPathRange.m
//  MyFunctionDemo
//
//  Created by Ting Han on 2017/9/22.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "IndexPathRange.h"

@implementation IndexPathRange

+ (NSMutableArray<NSIndexPath *> *)indexPathsFromIndexPathRanges:(NSArray<IndexPathRange *> *)indexPathRanges{
    NSMutableArray *arr = [NSMutableArray array];
    for (IndexPathRange *range in indexPathRanges) {
        for (NSUInteger i = range.location; i < range.location + range.length; i++) {
             [arr addObject:[NSIndexPath indexPathForRow:i inSection:range.section]];
        }
    }
    return arr;
}
@end
